package cn.ydt.ydt.community.webapi.controller;

import cn.ydt.ydt.common.resful.JsonResult;
import cn.ydt.ydt.community.service.ICommunityService;
import cn.ydt.ydt.pojo.community.vo.SimpleCommunityVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/community")
@Api(tags = "社区管理相关功能")
public class CommunityController {

    @Autowired
    ICommunityService communityService;

    @ApiOperation("后台登录时获取相关社区信息")
    @GetMapping("/login")
    public JsonResult<SimpleCommunityVO> getSimpleCommunity(){
        SimpleCommunityVO simpleCommunityVO = communityService.getSimCommunityById();
        return JsonResult.ok(simpleCommunityVO);
    }
}
